package com.cy.pj.module.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author Cx
 * @stage secondStageOfWeb
 * @creat 2020-11-04 9:57
 */
@Controller
public class ModelViewController {

    @RequestMapping("/doModelAndView")
    public String doModelAndView(Model model) {
        /* 参数model由spring web创建 可以存储数据 */
        model.addAttribute("username", "jason");
        model.addAttribute("state", true);
        return "view";
    }

}
